import request from '@/utils/request'
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
export function getEmployee(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}
export function addEmployee(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
export function batchEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
export function getUserInfoById(id) {
  return request({
    url: `/sys/user/${id}`
  })
}
export function updateUserInfoById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 获取员工个人信息
export function getUserDetailApi(id) {
  return request({
    url: `/employees/${id}/personalInfo`,
    method: 'get'
  })
}

// 保存员工个人信息
export function setUserDetailApi(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'PUT',
    data
  })
}
export function setAssignRolesApi(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
